import { BaseService, Service } from "/@/cool";

@Service({
	namespace: 'common',
	splice: false
})

class Common extends BaseService {

	// 图片验证码
	getCode = (params: any) => {
		return this.get(`/auth/code`, params)
	}

	login = (params: any) => {
		return this.post("/auth/login", params, {
			noInsert: true
		});
	}

	// 加载字典
	loadDictionary = (params: any) => {
		return this.post("/erp/loadDictionary", params);
	}

	// 获取用户信息
	user = (params: any) => {
		return this.post('/erp/userInfo', params)
	}

	// 旧 ---

	// 图片上传
	upload = (params: any) => {
		return this.get(`/upload/image`)
	}

	// 绑定角色列表查询
	bindList = (params: any) => {
		return this.get('/mp/users/bind/list', params)
	}

	// 修改密码
	updatePass = (params: any) => {
		return this.post('/mp/users/updatePass', params)
	}

	// 字典加载
	dicGet = (params: any) => {
		return this.post('/mp/erp/query/dic/get', params)
	}

	// 绑定微信
	bindWx = (params: any) => {
		return this.post('/weChat/bind', params)
	}

}

export default Common;